package models;

import java.util.*;
import models.mappers.*;
import voidlib.*;



/**
 * @author nevidimov
 */
public class Invite extends VoidModel {
    protected VoidMapper mapper = new InviteMapper();
    
    @Override
    public VoidMapper getMapper() {
        return mapper;
    }
    
    @Override
    protected String _getModelId() {
        return "id";
    }    
    
    public int _ownerId;
    public int _banditId;
    public long _created;
    public RequestStatus _status = RequestStatus.Pending;
    public int _id = -1;
    
    public Invite() {
    }
    
    public Invite(int ownerId, int banditId, long created) {
        this._banditId = banditId;
        this._ownerId = ownerId;
        this._created = created;
    }
    
    public User getOwner() {
        return new User().getMapper().fetchOne("id = ?", this._ownerId);
    }
    
    public int getId() {
        return _id;
    }
    
    public User getBandit() {
        return new User().getMapper().fetchOne("id = ?", this._banditId);
    }
    
    public long getCreated() {
        return _created;
    }
    
    public RequestStatus getStatus() {
        return _status;
    }
}
